$ ->
  $(document).ajaxError (event, xhr) ->
    data = JSON.parse xhr.responseText
    alert '系统繁忙，请稍后重试'
    console.log data.id
  .ajaxSuccess (event, xhr) ->
    data = JSON.parse xhr.responseText
    if data.status is off
      switch data.errors
        when 1 then alert '请登录'
        when 2 then alert data.tips
        else
          alert '未知错误'